import { EntitySchema } from '@mikro-orm/core';

export class LeFitmentTemplate {
  id!: string;
  name!: string;
  image!: string;
  content!: unknown;
  background!: string;
  createdTime!: string;
  updatedTime?: string;
  deletedTime?: string;
  isDeleted: boolean = false;
  writer!: string;
}

export const LeFitmentTemplateSchema = new EntitySchema({
  class: LeFitmentTemplate,
  properties: {
    id: { primary: true, type: 'string', columnType: 'bigint' },
    name: { type: 'string', length: 50 },
    image: { type: 'string', length: 255 },
    content: { type: 'unknown', columnType: 'longtext' },
    background: { type: 'string', length: 50, default: '#F7F7F7' },
    createdTime: { type: 'string', columnType: 'bigint' },
    updatedTime: { type: 'string', columnType: 'bigint', nullable: true },
    deletedTime: { type: 'string', columnType: 'bigint', nullable: true },
    isDeleted: { type: 'boolean', default: false },
    writer: { type: 'string', length: 50 },
  },
});
